import User from "src/models/User";
import { Module, Mutation, VuexModule } from "vuex-module-decorators";
@Module({})
export default class UserStore extends VuexModule {
  public user!: User;
  @Mutation
  public setUser(_user: User) {
    this.user = _user;
  }

  public get currentUser() {
    if (this.user) {
      return this.user;
    } else {
      const user: User = new User();
      user.banner = "static/pngs/banner.png";
      user.email = "admin@turtool.com";
      user.avatar = "static/pngs/avatar.png";
      user.username = "#Admin0000";
      return user;
    }
  }
}
